﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Controller2.Controllers
{
    [Authorize]
    public class ControladorExemploController : Controller
    {
        /// <summary>
        /// Controlador de exemplo de estrutura
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Cadastro(int id)
        {
            if (id > 0)
            {
                // abre o cadastro de alteracao
            }
            else
            {
                // abre o cadastro de inclusao
            }
            return View();
        }

        public ActionResult Salvar(int id)
        {
            try
            {
                if (id > 0)
                {
                    // salva a alteracao
                }
                else
                {
                    // salva a inclusao
                }
                return View();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public ActionResult Excluir(int id)
        {
            return View();
        }
    }
}
